package com.cupdata.marathon.definition;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum CouponTp {
    C1001("1001", 10000),
    C1002("1002", 5000),
    C1003("1003", 2500),

    C2001("2001", 5000),
    C2002("2002", 2000),
    C2003("2003", 500),
    ;
    private String code;
    private int value;

    public static int getValue(String code) {
        try {
            return valueOf("C" + code).getValue();
        } catch (Exception e) {
            return 0;
        }
    }

}
